<!-- search/templates/search/results.html -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Search Results - Ocean Drugs</title>
    <style>
        body { font-family: Arial, sans-serif; }
        .navbar { background-color: #333; color: white; padding: 10px; text-align: center; }
        .navbar a { color: white; margin: 0 15px; text-decoration: none; }
        .search-box { text-align: center; margin-top: 20px; }
        .search-box input { padding: 10px; font-size: 16px; width: 300px; }
        .search-results { margin-top: 30px; }
        .result-item { padding: 10px; border: 1px solid #ddd; margin: 5px 0; }
        .result-item h3 { margin: 0; font-size: 20px; }
        .result-item p { font-size: 16px; color: #555; }
    </style>
</head>
<body>

    <div class="navbar">
        <a href="/">Home</a>
        <a href="/about">About</a>
        <a href="/docs">Docs</a>
        <a href="/submit">Submit</a>
        <a href="/contact">Contact</a>
    </div>

    <div class="search-box">
        <form method="get" action="/search/">
            <input type="text" name="query" placeholder="Search for Ocean Drugs..." value="{{ query }}">
            <button type="submit">Search</button>
        </form>
    </div>

    <div class="search-results">
        {% if search_results %}
            <h3>Search Results for "{{ query }}":</h3>
            <ul>
                {% for result in search_results %}
                    <li class="result-item">
                        <h3>{{ result.name }}</h3>
                        <p><strong>Formula:</strong> {{ result.formula }}</p>
                        <p><strong>Structure:</strong> {{ result.structure }}</p>
                    </li>
                {% endfor %}
            </ul>
        {% elif query %}
            <p>No results found for "{{ query }}".</p>
        {% else %}
            <p>Please enter a search query.</p>
        {% endif %}
    </div>

</body>
</html>
